//
// SoapTrace.Net - A soap message monitoring utility. 
//
// Copyright (C) 2004 Matthew Ward
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// Matthew Ward (mrward@users.sourceforge.net)

using SoapTrace.Core.Communication;
using System;

namespace SoapTrace.Tests.Utils
{
	/// <summary>
	/// A <see cref="SoapMessage"/> mock object.
	/// </summary>
	public class MockSoapMessage : ISoapMessage
	{	
		/// <summary>
		/// The soap message.
		/// </summary>
		private string m_Message = String.Empty;
		
		/// <summary>
		/// The soap header.
		/// </summary>
		private string m_Header = String.Empty;
		
		/// <summary>
		/// The time received.
		/// </summary>
		private DateTime m_TimeReceived = new DateTime( 2000, 1, 1 );
		
		/// <summary>
		/// Creates a new instance of the <see cref="MockSoapMessage"/> class.
		/// </summary>
		public MockSoapMessage( )
		{
		}
		
		/// <summary>
		/// Sets the soap message.
		/// </summary>
		/// <param name="message">The soap message string.</param>
		public void SetMessage( string message )
		{
			m_Message = message;
		}
		
		/// <summary>
		/// Gets the soap message.
		/// </summary>
		string ISoapMessage.Message
		{
			get
			{
				return m_Message;
			}
		}

		/// <summary>
		/// Sets the soap header.
		/// </summary>
		/// <param name="header">The soap header string.</param>
		public void SetHeader( string header )
		{
			m_Header = header;
		}
		
		/// <summary>
		/// Gets the Http header.
		/// </summary>
		string ISoapMessage.Header
		{ 
			get
			{
				return m_Header;
			}
		}

		/// <summary>
		/// Gets or sets the time this message was received.
		/// </summary>
		DateTime ISoapMessage.TimeReceived
		{ 
			get
			{
				return m_TimeReceived;
			}
			
			set
			{
				m_TimeReceived = value;
			}
		}

		/// <summary>
		/// Adds a single Http message byte to the soap message.
		/// </summary>
		/// <param name="messageByte"></param>
		/// <returns></returns>
		bool ISoapMessage.AddByte( byte messageByte )
		{
			return false;
		}

		/// <summary>
		/// Clears the soap message.
		/// </summary>
		void ISoapMessage.Clear( )
		{
		}
	}
}
